Skip to content

Improve Kotlin comment filtering#79

Open
Vladyslav-Kuksiuk wants to merge 7 commits into
masterfrom
improve-kotlin-comment-filtering
Open

Improve Kotlin comment filtering#79
Vladyslav-Kuksiuk wants to merge 7 commits into
masterfrom
improve-kotlin-comment-filtering

Conversation

@Vladyslav-Kuksiuk

Copy link
Copy Markdown
Collaborator

This PR improve Kotlin comment filtering.

Resolves this issue.

@Vladyslav-Kuksiuk Vladyslav-Kuksiuk self-assigned this Jul 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses Issue #64 by introducing a Kotlin-specific comment filter so Kotlin sources no longer rely on the Java-style marker scanner, improving handling for nested block comments and Kotlin raw (""") strings with interpolation.

Changes:

  • Added KotlinCommentFilter with Kotlin-aware scanning for nested block comments, raw strings, and ${...} interpolation filtering.
  • Registered the Kotlin filter for .kt and .kts extensions.
  • Added Kotlin-focused golden tests for multiple comment-retention modes and Kotlin-specific constructs.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
embedding/commentfilter/kotlin.go New Kotlin-aware comment filter implementation (nested block comments, raw strings, interpolation).
embedding/commentfilter/filter_test.go Adds Kotlin golden tests for comment modes and raw string/interpolation behavior.
embedding/commentfilter/config.go Switches .kt/.kts to use KotlinCommentFilter instead of Java-style marker filtering.

Comment thread embedding/commentfilter/kotlin_filter.go
Comment thread embedding/commentfilter/filter_test.go
@Vladyslav-Kuksiuk Vladyslav-Kuksiuk marked this pull request as ready for review July 3, 2026 11:12

@Oleg-Melnik Oleg-Melnik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Vladyslav-Kuksiuk LGTM with minor comment to address.

@@ -0,0 +1,361 @@
// Copyright 2026, TeamDev. All rights reserved.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The kotlin.go file name looks too general. Consider using a more specific name, such as kotlin_filter.go, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Kotlin-specific comment filtering

4 participants